﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DAO;
using System.Web.Security;
using Entidades;
using System.Security.Principal;

public partial class MasterPage : System.Web.UI.MasterPage
{


    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["user"] != null)
        {
            SiteMapDataSource1.SiteMapProvider = "XmlSiteMapProviderAdmin";
            lblUser.Text = Session["user"].ToString();
            btnCerrarSes.Visible = true;
            lnkIniciarSesion.Visible = false;
            tvMenu.Visible = true;
        }
        else
        {
            lnkIniciarSesion.Visible = true;
        }


        

    }




    protected void btnCerrarSes_Click(object sender, EventArgs e)
    {
        Session.Abandon();
        Response.Redirect("~/Inicio.aspx");
    }
    protected void lnkIniciarSesion_Click(object sender, EventArgs e)
    {
        Response.Redirect("~/Login.aspx");
    }
}
